/*
 * @Author: huangtianyang 916072572@qq.com
 * @Date: 2023-01-13 10:31:02
 * @LastEditors: huangtianyang
 * @LastEditTime: 2023-08-14 14:19:16
 * @FilePath: \report\config.ts
 */

export const rule_1 = [
    { range: [90, 95], deduct: 2 },
    { range: [80, 90], deduct: 6 },
    { range: [65, 80], deduct: 12 },
    { range: { min: 65 }, deduct: 36 } //低于65分（不包含）
]

const rule_2 = [
    { range: [0.5, 1.5], deduct: 3 },
    { range: [1.5, 3], deduct: 6 },
    { range: { max: 3 }, deduct: 12 }
]

const rule_3 = [
    { range: [0.5, 1.5], deduct: 3 },
    { range: [1.5, 3], deduct: 12 },
    { range: { max: 3 }, deduct: 36 }
]
interface scoreParams {
    [propname: string]: any
}
// 新能源车况报告评分规则
export const SCORE_RULE: scoreParams = {
    //电池容量保持率
    volumeScore: rule_1,
    //内阻
    internalResistanceScore: rule_1,
    //自放电率
    selfDischargeRateScore: rule_1,
    //温度一致性
    temperatureConsistenceScore: rule_1,
    //电压一致性
    voltConsistenceScore: rule_1,
    //快充占比
    fastRatio: { max: 0.75, deduct: 6 },
    //次均充入SOC
    chaSocAvg: { min: 25, deduct: 3 },
    //充电最高频率下的起始 SOC
    chaStartSoc: { max: 70, deduct: 3 },
    //充电最高温度平均
    chaMaxTempMean: { max: 45, deduct: 6 },
    //充电最低温度平均
    chaMinTempMean: [
        { min: -5, deduct: 3 },
        { max: 30, deduct: 3 }
    ],
    //充电电芯平均压差
    chaVoltDiffMean: { max: 50, deduct: 12 },
    //行驶最高温度平均
    driveMaxTempMean: { max: 45, deduct: 6 },
    //行驶最低温度平均
    driveMinTempMean: [
        { min: -5, deduct: 3 },
        { max: 30, deduct: 3 }
    ],
    //行车最高频率下的截止SOC
    driveEndSoc: { min: 50, deduct: 3 },
    //舒适温度运行占比
    optimumTempPro: { min: 0.5, deduct: 6 },
    //一级故障水平
    abnormalA: [
        { range: [0.5, 1.5], deduct: 1 },
        { range: [1.5, 3], deduct: 3 },
        { range: { max: 3 }, deduct: 9 }
    ],
    //二级级故障水平
    abnormalB: rule_2,
    //三级级故障水平
    abnormalC: rule_3,
    //热管理水平
    batteryThermalManage: rule_2,
    //电压管理水平
    voltManage: rule_2,
    //电量管理水平
    powerManage: rule_2,
    //电压一致性管理水平
    voltConsistManage: rule_3,
    //绝缘管理水平
    insulateManage: rule_3,
    //DC-DC管理水平
    dcdcManage: rule_3,
    //电机热管理水平
    motorThermalManage: rule_3,
    //其他管理水平
    otherManage: rule_3
}

export enum SCORE_RULE_NAME {
    volumeScore = '电池容量保持率',
    //
    internalResistanceScore = '内阻',
    //
    selfDischargeRateScore = '自放电率',
    //
    temperatureConsistenceScore = '温度一致性',
    //
    voltConsistenceScore = '电压一致性',
    //
    fastRatio = '快充占比',
    //
    chaSocAvg = '次均充入SOC',
    //
    chaStartSoc = '充电最高频率下的起始 SOC',
    //
    chaMaxTempMean = '充电最高温度平均',
    //
    chaMinTempMean = '充电最低温度平均',
    //
    chaVoltDiffMean = '充电电芯平均压差',
    //
    driveMaxTempMean = '行驶最高温度平均',
    //
    driveMinTempMean = '行驶最低温度平均',
    //
    driveEndSoc = '行车最高频率下的截止SOC',
    //
    optimumTempPro = '舒适温度运行占比',
    //
    abnormalA = '一级故障水平',
    //
    abnormalB = '二级级故障水平',
    //
    abnormalC = '三级级故障水平',
    //
    batteryThermalManage = '热管理水平',
    //
    voltManage = '电压管理水平',
    //
    powerManage = '电量管理水平',
    //
    voltConsistManage = '电压一致性管理水平',
    //
    insulateManage = '绝缘管理水平',
    //
    dcdcManage = 'DC-DC管理水平',
    //
    motorThermalManage = '电机热管理水平',
    //
    otherManage = '其他管理水平'
}
